package com.模板模式.ctrl;

import com.模板模式.ExportEnum;
import com.模板模式.Fatory;
import com.模板模式.pojo.Goods;
import com.模板模式.pojo.Order;
import com.模板模式.pojo.User;
import com.模板模式.service.ExportGoodsServiceImpl;
import com.模板模式.service.ExportOrderServiceImpl;
import com.模板模式.service.ExportSuperService;
import com.模板模式.service.ExportUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
public class ExportController {





    @GetMapping(value = "/export")
    public void exportUser( HttpServletResponse response,String param){
        ExportEnum exportEnum = ExportEnum.valueOf(param);
        ExportSuperService exportSuperService = Fatory.get(exportEnum);
        List list = exportSuperService.findList();
        exportSuperService.export(list, exportEnum,response);

    }


}
